package com.ssm.xml.service.impl;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ssm.xml.entity.User;
import com.ssm.xml.mapper.UserMapper;
import com.ssm.xml.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author 张富玮
 * @create 2022-01-28 19:58
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAllUsers() {
        return userMapper.selectList(new QueryWrapper<>());
    }

    @Override
    public boolean login(String account,String password) {
        User user=userMapper.selectById(account);
        if(user.getPassword().equals(password)){
            return true;
        }
        return  false;
    }

}
